package adc.app.ui.wicket.table;

import org.apache.wicket.model.IModel;
import org.apache.wicket.model.PropertyModel;

public class CheckPropertyColumn<T> extends CheckColumn<T> {

	private static final long serialVersionUID = 1L;
	
	private String checkProperty;

	public CheckPropertyColumn(String sortProperty, String checkProperty) {
		super(sortProperty);
		this.checkProperty = checkProperty;
	}
	
	public CheckPropertyColumn(String checkProperty) {
		super();
		this.checkProperty = checkProperty;
	}

	public String getCheckProperty() {
		return checkProperty;
	}

	public CheckPropertyColumn<T> setCheckProperty(String checkProperty) {
		this.checkProperty = checkProperty;
		return this;
	}

	@Override
	protected IModel<T> createCheckModel(IModel<T> rowModel) {
		return new PropertyModel<T>(rowModel, this.checkProperty);
	}
}
